<template>
	<view>
		<view class="mas_detail">
			<view>
				<!-- 标题 -->
				<view class="viewCenter">
					<text>{{announcementDetail.title||'暂无数据'}}</text>
					<text>{{announcementDetail.pushTime && announcementDetail.pushTime.split('T')[0]}}</text>
				</view>
				<view class="detailContent">
					<!-- 内容 -->
					<text>{{announcementDetail.content||'暂无数据...'}}</text>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				announcementDetail: {},
				title: '', //标题
				content: '', //内容
				pushTime: '', //时间

			};
		},
		onLoad: function(options) {
			// 需要转换 JSON：通常用于与服务端交换数据。在向服务器发送数据时一般是字符串。
			this.announcementDetail = JSON.parse(options.item) //接收传过来的item
			console.log('接收消息列表的item', this.announcementDetail);
		}
	}
</script>

<style lang="less" scoped>
	page {
		background-color: #F5F5F5;
	}

	.mas_detail {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		margin-top: 30rpx;

		>view {
			margin-top: 10rpx;
			width: 96%;
			background-color: #fff;
			border-radius: 10rpx;
			padding: 20rpx 0 20rpx 0;

			>text:nth-child(2) {
				margin-left: 40rpx;
			}
		}

		.viewCenter {
			width: 100%;
			// background-color: aqua;
			display: flex;
			align-items: center;
			flex-direction: column;
			justify-content: space-around;

			>text:nth-child(1) {
				margin-left: 40rpx;
				font-weight: 700;
			}
		}

		.detailContent {
			text-align: left;
			text-indent: 20rpx;
			width: 90%;
			margin: auto;
			margin-top: 20rpx;

			>text {
				font-size: 23rpx;
			}

		}
	}
</style>
